<template>
    <div>
        活动id:{{active_id}}
        <br>
        价格：{{price}}
        <br>
        手机号 <input type="text" v-model="mobile">
        <button @click="add">加入活动</button>
        <br>
        {{order_id}}
        <br>
        {{money}}
    </div>
</template>

<script>
    export default {
        data() {
            return {
                mobile:'',
                //活动id
                active_id:this.$route.query.id,
                price:this.$route.query.price,
                order_id :0,
                money:0
            }
        },
        methods: {
            //添加用户
            add(){
                this.$axios.post('/users/active/',{active_id:this.active_id,mobile:this.mobile,price:this.price}).then(res=>{
                    this.order_id=res.data.order_id
                    this.money = res.data.money
                    this.$router.push({path:'/snumber',query:{'order_id':this.order_id,'money':this.money}})
                })
            }
        },
    }
</script>

<style scoped>

</style>